package com.ymxk.timestar.view.smritimap;

import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * 对外扩展一个接口，
 * 最终要实现在外部可以挂在数据，
 * 以及可以能够使得在外部可以实现加载图片的方式。
 */
public abstract class SmritiEntity {

    private int nodeType;
    /**
     * 权限等级、
     */
    private int grade;

    public abstract String getStarName();

    @DrawableRes
    public abstract int getStarIconId();

    /**
     * 主继承人节点
     */
    public abstract SmritiEntity mainChild();

    /**
     * 辅继承人节点、
     */
    public abstract SmritiEntity lesserChild();

    /**
     * 辅父节点
     */
    public abstract SmritiEntity lesserParent();

    public abstract String getResKey();

    public int getNodeType() {
        return nodeType;
    }

    public void setNodeType(@INodeType int nodeType) {
        this.nodeType = nodeType;
    }

    public static final int NODE_CENTER = 0;
    public static final int NODE_LEFT = 1;
    public static final int NODE_RIGHT = 2;
    public static final int NODE_LEFT_TOP = 3;

    @IntDef({NODE_CENTER, NODE_LEFT, NODE_RIGHT, NODE_LEFT_TOP})
    @Retention(RetentionPolicy.SOURCE)
    @interface INodeType {
    }

    public int getGrade() {
        return grade;
    }

    public void setGrade(int grade) {
        this.grade = grade;
    }

    public abstract boolean isSelf();

    public abstract boolean isSelfParent();
}